<?php
	session_start(); 
	include('inactividad.php');
	if(isset($_GET['sala'])){
		$iIdSala = $_GET['sala'];
		
		include('DAOSalas.php');
		$oDaoSalas = new DAOSalas;
		$oSala = $oDaoSalas->getSalaById($iIdSala);
		
		$iAnio = date('Y');
		$iMes = date('m');
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Agenda Centro Cultural Universitario</title>
<link rel='stylesheet' type='text/css' href='../css/cupertino/theme.css' />
<link rel='stylesheet' type='text/css' href='../script/fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../script/fullcalendar/fullcalendar.print.css' media='print' />
<link href="../css/view.css" rel="stylesheet" type="text/css"/>
<script type='text/javascript'>
	var iSala = <?php echo $iIdSala; ?>;
</script>
<script type='text/javascript' src='../script/jquery/jquery-1.5.2.min.js'></script>
<script type='text/javascript' src='../script/jquery/jquery-ui-1.8.11.custom.min.js'></script>
<script type='text/javascript' src='../script/fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript' src='../script/agenda.js'></script>
<script type='text/javascript' src='../script/utilidades.js'></script>
<script type='text/javascript' src='../script/zxml.js'></script>
</head>

<body>
	<div id="flash">
		<?php 
            include('../encabezado.php');
        ?>
	</div>
    <div id="regresar"><a href="listaSalas.php">Regresar</a></div>
	<div id="encabezado">
    	<h2>AGENDA <?php echo $oSala[0]->getNombre(); ?></h2>
        <div id="moveDate">
        	<select name="anio" id="anio" onchange="goToDate(this.value+'-'+document.getElementById('mes').value)">
    						<?php
								$sSelected = "";
								for($numOptionsAnio=2011;$numOptionsAnio<2026;$numOptionsAnio++){
									if($iAnio == $numOptionsAnio)
										$sSelected = 'selected="selected"';
									echo '<option value="'.$numOptionsAnio.'" '.$sSelected.' > '.$numOptionsAnio.' </option>';
									$sSelected = "";
								}	
							?>
    		</select>
            <select name="mes" id="mes" onchange="goToDate(document.getElementById('anio').value+'-'+this.value);">
                                    <?php 
                                        for($numOptionsMes=1;$numOptionsMes<13;$numOptionsMes++){
                                            if($iMes == $numOptionsMes)
                                                $sSelected = 'selected="selected"';
                                            
                                            if($numOptionsMes<10)
                                                    echo '<option value="0'.$numOptionsMes.'" '.$sSelected.'> 0'.$numOptionsMes.' </option>';
                                            else
                                                echo '<option value="'.$numOptionsMes.'" '.$sSelected.'> '.$numOptionsMes.' </option>';
                                            $sSelected = "";
                                        }
                                    ?>
            </select>
        </div>
    </div>
	<div id='calendar'></div>
	<?php
	}else
		echo "No existe esta sala"
 	?>
</body>
</html>
